//
//  VolunteerRegisterController.m
//  HZHome
//
//  Created by Alawn on 13-10-13.
//  Copyright (c) 2013年 xzysun. All rights reserved.
//

#import "VolunteerRegisterController.h"
#import "UIColor+expanded.h"
@interface VolunteerRegisterController ()

@end

@implementation VolunteerRegisterController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    self.title=@"志愿者注册";
    // Do any additional setup after loading the view from its nib.
    self.labelTitle.textColor=[UIColor colorWithHexString:@"005AB5"];
    self.labelGroup1Title.textColor=[UIColor colorWithHexString:@"005AB5"];
    self.labelGroup2Title.textColor=[UIColor colorWithHexString:@"005AB5"];
    self.labelGroup3Title.textColor=[UIColor colorWithHexString:@"005AB5"];
    self.labelGroup4Title.textColor=[UIColor colorWithHexString:@"005AB5"];
    
    self.imgViewGroup1.backgroundColor=[UIColor colorWithHexString:@"dadada"];
    self.imgViewGroup2.backgroundColor=[UIColor colorWithHexString:@"dadada"];
    self.imgViewGroup3.backgroundColor=[UIColor colorWithHexString:@"dadada"];
    self.imgViewGroup4.backgroundColor=[UIColor colorWithHexString:@"dadada"];
    [self.mywebView loadHTMLString:@"<html><table><tr><td><h6>1、网上注册：志愿时网站注册【链接转入志愿时网站：<a href="@"'"@"http://www.125cn.net/site/personalRegisterAction!register.do"@"' target='_blank'>http://www.125cn.net/site/personalRegisterAction!register.do </a>】或下载志愿时系统安卓手机客户端【链接链接下载网址：<a href="@"'"@"http://www.125cn.net/upload/volunteer-mobile.apk"@"' target='_blank'>http://www.125cn.net/upload/volunteer-mobile.apk】</a></h6></td></tr><tr><td><h6>2、现场报名：市民可到海珠区青年志愿者协会办公室进行现场报名</h6></td></tr><table></html>" baseURL:nil];
//    self.textMethod.editable=NO;
//    self.textMethod.dataDetectorTypes=UIDataDetectorTypeAll;
    [self.myscrollView setContentSize:CGSizeMake(320, 1100.0)];
}
#pragma mark - UIWebView Delegate
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
{
    NSURL *requestURL =[request URL];
    if (([[requestURL scheme] isEqualToString: @"http"] || [[requestURL scheme] isEqualToString:@"https"] || [[requestURL scheme] isEqualToString: @"mailto" ])
        && (navigationType == UIWebViewNavigationTypeLinkClicked)) {
        return ![[UIApplication sharedApplication] openURL:requestURL];
    }
    return YES;
}
- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
-(IBAction)callPhone:(id)sender
{
    NSString* numberAfterClear =self.btnCallPhone.titleLabel.text;
    NSURL *phoneNumberURL = [NSURL URLWithString:[NSString stringWithFormat:@"tel:%@", numberAfterClear]];
    NSLog(@"make call, URL=%@", phoneNumberURL);
    [[UIApplication sharedApplication] openURL:phoneNumberURL];
}

@end
